﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;

namespace ExtenDev.Web.Management
{
    public class ResourceConfigurationSection : ConfigurationSection
    {

        public string ResourceHandlerUrl
        {
            get
            {
                return this[s_resourceHandlerUrl] as string;
            }
            set
            {
                this[s_resourceHandlerUrl] = value;
            }
        }

        public ResourceConfigurationElementCollection Resources
        {
            get
            {
                return this[s_resources] as ResourceConfigurationElementCollection;
            }
            set
            {
                this[s_resources] = value;
            }
        }

        protected override ConfigurationPropertyCollection Properties
        {
            get
            {
                return s_properties;
            }
        }
        
        private static readonly ConfigurationPropertyCollection s_properties;
        private static readonly ConfigurationProperty s_resourceHandlerUrl;
        private static readonly ConfigurationProperty s_resources;

        static ResourceConfigurationSection()
        {
            s_properties = new ConfigurationPropertyCollection();

            s_resourceHandlerUrl = new ConfigurationProperty("ResourceHandlerUrl", typeof(string), "~/MicroResource.ashx");
            s_resources = new ConfigurationProperty("Resources", typeof(ResourceConfigurationElementCollection));

            s_properties.Add(s_resourceHandlerUrl);
            s_properties.Add(s_resources);
        }

    }

    public class ResourceConfigurationElement : ConfigurationElement
    {

    }

    public class ResourceConfigurationElementCollection : ConfigurationElementCollection
    {

        protected override ConfigurationElement CreateNewElement()
        {
            throw new NotImplementedException();
        }

        protected override object GetElementKey(ConfigurationElement element)
        {
            throw new NotImplementedException();
        }
    }

}
